<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page contentType="text/html; charset=UTF-8" language="java"
	import="java.util.*" pageEncoding="UTF-8"%>

<%@ taglib prefix="s" uri="/struts-tags"%>


<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
  <head>
    <base href="<%=basePath%>">    
    <title>顶呱呱注册接口</title>    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript"
			src="<%=path%>/manage/js/jquery-1.4.4.min.js"></script>
	<script type="text/javascript"
			src="<%=path%>/manage/js/jquery.validate.min.js"></script>
	<script type="text/javascript"
		src="<%=path%>/manage/js/jquery.validate.methods.min.js"></script>
	<link type="text/css" href="<%=path%>/manage/css/layout.css"
			rel="stylesheet" />
	<script type="text/javascript">
	 //全局,js中用
	 var root = "<%=path%>";
	 
	 $(document).ready(function() {
	 	myForm = $("#makeApp").validate({
			rules : {
				"appApiDto.ptId" : {
					required : true
				},
				"appApiDto.password" : {
					required : true
				},
				"appApiDto.appName" : {
					required : true
				},
				"appApiDto.interfaceUrl" : {
					required : true
				},
				"appApiDto.enterInfo.varEnterpName" : {
					required : true
				}

			},
			messages : {
				"appApiDto.ptId" : {
					required : "合作商ID必填"
				},
				"appApiDto.password" : {
					required : "认证密码必填  "
				},
				"appApiDto.appName" : {
					required : "应用名称必填"
				},
				"appApiDto.interfaceUrl" : {
					required : "接口地址必填  "
				},
				"appApiDto.enterInfo.varEnterpName" : {
					required : "企业名称必填  "
				}
				

			}
		});
	 });

	function check() {
		if(myForm.valid()){
			$("#makeApp").submit();
		}
	}
</script>
	<style type="text/css">
		li{margin:5px auto}
	</style>
  </head>
  
  <body style="background-color: #999999；">
  <div style="margin-left:100px;">
   <form name="makeApp" id="makeApp" action="<%=path%>/api/createApp.action" method="post">
     <div>
     <ul>
     <li> <label>合作商ID</label><s:textfield name="appApiDto.ptId" id="ptId"></s:textfield>  </li>
     <li> <label>认证密码</label><s:textfield name="appApiDto.password"></s:textfield>  </li>
     <li> <label>时间戳</label><s:textfield name="appApiDto.time"></s:textfield>  </li>
     <li> <label>应用名称</label><s:textfield name="appApiDto.appName"></s:textfield>  </li>
     <li> <label>接口地址</label><s:textfield name="appApiDto.interfaceUrl"></s:textfield>  </li>
     
      <li> <label>企业信息</label>
         <ul>
         <li> <label>企业名称</label><s:textfield name="appApiDto.enterInfo.varEnterpName"></s:textfield></li>
         <li> <label>联系人</label><s:textfield name="appApiDto.enterInfo.varEnterpLegalPerson"></s:textfield></li>
         <li> <label>联系电话</label><s:textfield name="appApiDto.enterInfo.varEnterpPhonenum"></s:textfield></li>
         <li> <label>联系邮箱</label><s:textfield name="appApiDto.enterInfo.varEnterpEmail"></s:textfield></li>
         </ul>    
     </ul>   
   </div>
   <input type="button" value="提交" onclick="check()">  
   </form>
   <s:iterator value="resultlist">
   <div id="list">
     <ul>
     <li> <label>状态:</label><font color="red"><s:if test="status==0">失败</s:if><s:if test="status==1">成功</s:if></font></li>
     <li> <label>状态描述:</label><font color="red"><s:property value="resultmsg"/>  </font></li>
     <li> <label>应用ID:</label><font color="red"><s:property value="appId"/> </font> </li>
     <li> <label>应用账号:</label><font color="red"><s:property value="appAccount"/> </font> </li>
     <li> <label>应用管理账号:</label><font color="red"><s:property value="contentAccount"/></font> </li>
     <li> <label>密码:</label><font color="red"><s:property value="password"/> </font></li>
     <li> <label>应用管理地址:</label><a href="<s:property value="appmanagerUrl"/>"><font color="red"><s:property value="appmanagerUrl"/></font></a></li>
        
     </ul>   
   </div>
   </s:iterator>
   
   </div>
  </body>
</html>
